package com.lauroc.dept.controller;

import com.lauroc.basic.utils.AjaxResult;
import com.lauroc.dept.domain.Employee;
import com.lauroc.dept.service.IEmployeeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/emp")
@Api(tags={"用户接口"})
public class EmployeeCotroller {

    @Autowired
    private IEmployeeService service;

    @ApiOperation(value="查询员工经理", notes="查询员工经理列表")
    @GetMapping("/findManagers")
    public AjaxResult findManagers(){
        List<Employee> employees = service.findManagers();
        return AjaxResult.createSuccess(employees);
    }


    @ApiOperation(value="查询所有员工信息", notes="查询员工列表")
    @GetMapping("/findAll")
    public AjaxResult getAll(){
        return AjaxResult.createSuccess(service.getAll());
    }


}
